function message(res) {
    if (res.type == true) {
        if(res.message!=0){
            $.bootstrapGrowl(res.message, {type: 'success', width: 'auto'});
        }
        return true;
    } else if (res.type == false) {
        $.bootstrapGrowl(res.message, {
            type: 'danger',
            width: 'auto'
        });
        return false;
    } else {
        $.bootstrapGrowl(res, {
            type: 'danger',
            width: 'auto'
        });
        return false;
    }
}
function success(message) {
    $.bootstrapGrowl(message, {type: 'success', width: 'auto'});
}
function danger(message) {
    $.bootstrapGrowl(message, {
        type: 'danger',
        width: 'auto'
    });
}
function paginationLoad() {
    $(".pagination a").on('click',function (event) {
        event.preventDefault();
        var href = $(this).attr("href");
        loadContent(href);
    });
}
function confirm(message,dosomething) {
    BootstrapDialog.show({
        title: '确认信息',
        message: message,
        buttons: [{
            label: '确定',
            action: function(dialog) {
                dosomething();
                dialog.close();
            }
        }, {
            label: '取消',
            action: function(dialog) {
                dialog.close();
            }
        }]
    });

}
// kindeditor拓展
var editoritem_all = [ 'source', '|', 'undo', 'redo', '|', 'preview', 'print',
    'template', 'cut', 'copy', 'paste', 'plainpaste', 'wordpaste', '|',
    'justifyleft', 'justifycenter', 'justifyright', 'justifyfull',
    'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent',
    'subscript', 'superscript', 'clearhtml', 'quickformat', 'selectall',
    '|', 'fullscreen', '/', 'formatblock', 'fontname', 'fontsize', '|',
    'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
    'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'flash',
    'media', 'insertfile', 'table', 'hr', 'emoticons', 'map', 'code',
    'pagebreak', 'anchor', 'link', 'unlink' ];
var editoritem_default = [ 'source', '|', 'undo', 'redo', '|', 'justifyleft',
    'justifycenter', 'justifyright', 'justifyfull', 'insertorderedlist',
    'insertunorderedlist', 'indent', 'outdent', 'subscript', 'superscript',
    'clearhtml', 'selectall', '/', 'formatblock', 'fontname', 'fontsize',
    '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
    'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'flash',
    'media', 'insertfile', 'table', 'emoticons', 'code', 'link', 'unlink' ];
var editoritem_more = [ 'source', '|', 'undo', 'redo', '|', 'preview', 'print',
    'template', 'cut', 'copy', 'paste', 'plainpaste', 'wordpaste', '|',
    'justifyleft', 'justifycenter', 'justifyright', 'justifyfull',
    'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent',
    'subscript', 'superscript', 'clearhtml', 'quickformat', 'selectall',
    '/', 'formatblock', 'fontname', 'fontsize', '|', 'forecolor',
    'hilitecolor', 'bold', 'italic', 'underline', 'strikethrough',
    'lineheight', 'removeformat', '|', 'image', 'flash', 'media',
    'insertfile', 'table', 'hr', 'emoticons', 'code', 'pagebreak',
    'anchor', 'link', 'unlink' ];
function initEdit(name,module,resizeType){
    if(resizeType == null){
        resizeType =1;
    }
    var editor = KindEditor.create('textarea[name="'+name+'"]', {
        resizeType : 1,
        allowPreviewEmoticons : true,
        allowImageUpload : true,
        allowFileManager : true,
        resizeType:resizeType,
        urlType : 'relative',
        items:editoritem_more,
        uploadJson:'static/admin/lib/kindeditor/upload_json.php?module='+module,
        fileManagerJson:'static/admin/lib/kindeditor/file_manager_json.php?module='+module,
        afterBlur: function(){this.sync();},
        filterMode: false//是否开启过滤模式
    });
    return editor;
}